import { default as request, cloud } from '@/framework/utils/request'
const YXXX = '/intentionRec',
  CJRoules = '/collectionRules', XS = '/clueData'
export default ({
  // 意向信息
  getYXXXList(data) {
    return request({
      url: `${cloud.investment}${YXXX}/page`,
      method: 'post',
      data
    })
  },
  delYXXXItem(data) {
    return request({
      url: `${cloud.investment}${YXXX}/delete`,
      method: 'post',
      data
    })
  },
  // 采集规则
  getCJRoulesList(data){
    return request({
      url: `${cloud.investment}${CJRoules}/list`,
      method: 'post',
      data
    })
  },
  addCJRoulesItem(data){
    return request({
      url: `${cloud.investment}${CJRoules}/save`,
      method: 'post',
      data
    })
  },
  editCJRoulesItem(data){
    return request({
      url: `${cloud.investment}${CJRoules}/upDateById`,
      method: 'post',
      data
    })
  },
  delCJRoulesItem(data){
    return request({
      url: `${cloud.investment}${CJRoules}/delete`,
      method: 'get',
      params: data
    })
  },
  zxCJRoulesItem(data){
    return request({
      url: `${cloud.investment}${CJRoules}/start`,
      method: 'get',
      params: data
    })
  },
  //执行日志
  getELogList(data){
    return request({
      url: `${cloud.investment}/collectionRulesLog/list`,
      method: 'post',
      data
    })
  },
  // 线索管理
  getXSList(data){
    return request({
      url: `${cloud.investment}${XS}/list`,
      method: 'post',
      data
    })
  },
  addXSItem(data){
    return request({
      url: `${cloud.investment}${XS}/save`,
      method: 'post',
      data
    })
  },
  editXSItem(data){
    return request({
      url: `${cloud.investment}${XS}/updata`,
      method: 'post',
      data
    })
  },
  delXSItem(data){
    return request({
      url: `${cloud.investment}${XS}/delete`,
      method: 'get',
      params: data
    })
  },
  importXS(data) {
    return request({
      url: `${cloud.investment}${XS}/import`,
      method: 'post',
      data,
      headers: {
        'Content-Type': 'multipart/form-data'
      }
    })
  },
  exportXS(data = { type: 2 }) {
    return request({
      url: `${cloud.investment}${XS}/export`,
      method: 'post',
      data,
      responseType: 'arraybuffer'
    })
  },
  ffXSItem(data){
    return request({
      url: `${cloud.investment}${XS}/distribute`,
      method: 'post',
      data
    })
  },
  claimXSItem(data){
    return request({
      url: `${cloud.investment}${XS}/claim`,
      method: 'post',
      data
    })
  },
  employXSItem(data){
    return request({
      url: `${cloud.investment}${XS}/employ`,
      method: 'get',
      params: data
    })
  },
  getUserOfZB(data) {
    return request({
      url: `${cloud.investment}${XS}/getUserType`,
      method: 'get',
      params: data
    })
  },
})
